<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="/public :: #public_head"></head>
<body>
<header th:replace="/public :: #public_header"></header>
<section th:replace="/public :: #public_time"></section>
<!---->
<section class="publicMian ">
    <div class="left" th:replace="/public :: #public_left"></div>
    <div class="right">
        <div class="location">
            <strong>你现在所在的位置是:</strong>
            <span>用户管理页面>用户信息修改</span>
        </div>
        <div class="providerUpdate">
            <form id="updateForm" action="#" th:action="@{/user/update}" th:method="post">
                <!--发送put请求修改信息-->

                <!--1. 在SpringMVC中配置HiddenHttpMethodFilter（SpringBoot自动配置好了）-->
                <!--2. 页面创建一个method="post"表单-->
                <!--3. 创建一个input标签 name="_method"，value="指定请求方式"-->
                <input th:type="hidden" name="_method" value="put"/>
                <input th:type="hidden" name="id" th:value="${user.id}"/>
                <input th:type="hidden" name="username" th:value="${user.username}">
                <input th:type="hidden" name="password" th:value="${user.password}">

                <div class="formItem">
                <label for="realName">真实姓名：</label>
                <input type="text" th:value="${user.realName}" name="realName" id="realName" placeholder="韩露"/>
                <span >*</span>
                </div>
                <div class="formItem">
                    <label >用户性别：</label>
                    <select name="gender" id="gender">
                        <option th:selected="${user.gender == 1}" value="1">女</option>
                        <option th:selected="${user.gender == 2}" value="2">男</option>
                    </select>
                </div>
                <div class="formItem">
                    <label for="birthday">出生日期：</label>
                    <input type="text" th:value="${#dates.format(user.birthday,'yyyy-MM-dd')}" name="birthday" id="birthday" placeholder="1999-01-01"/>
                </div>
                <div class="formItem">
                    <label >用户类别：</label>
                    <input type="radio" th:checked="${user.userType == 1}" name="userType" value="1">管理员
                    <input type="radio" th:checked="${user.userType == 2}" name="userType" value="2">经理
                    <input type="radio" th:checked="${user.userType == 3}" name="userType" value="3">普通用户
                </div>
                <div class="providerUpdateBtn">
                    <input type="submit" value="提交" onclick="$('updateForm').submit()"/>
                    <input type="button" value="返回" onclick="history.back(-1)"/>
                </div>
            </form>
        </div>
    </div>
</section>
<footer th:replace="/public::#public_footer"></footer>
</body>
</html>